﻿using System.IO;
using System.Xml.Serialization;

namespace DataXml
{
  public class XmlHelper
  {
    public static T ReadXml<T>(Stream stream)
    {
      if (stream != null)
      {
        var xmlSerializer = new XmlSerializer(typeof (T));
        return (T) xmlSerializer.Deserialize(stream);
      }
      return default(T);
    }
  }
}